package sixth.group.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sixth.group.dao.OrderinfMapper;
import sixth.group.domain.Orderinf;
import sixth.group.domain.OrderinfExample;
import sixth.group.service.WwzOrderinfService;

import java.util.List;

@Service(value = "orderinfService")
public class WwzOrderinfServiceImpl implements WwzOrderinfService {

    @Autowired
    private OrderinfMapper orderinfMapper;

    @Override
    public List<Orderinf> CustomerCheckOrderinf(int cid) {

        OrderinfExample example = new OrderinfExample();
        OrderinfExample.Criteria criteria = example.createCriteria();
        criteria.andOcustomeridEqualTo(cid);
        List<Orderinf> orderinfs= orderinfMapper.selectByExampleWithObject(example);
        return orderinfs;
    }

    @Override
    public List<Orderinf> RestaurantCheckOrderinf(int rid) {
        OrderinfExample example = new OrderinfExample();
        OrderinfExample.Criteria criteria = example.createCriteria();
        criteria.andOresaurantidEqualTo(rid);
        List<Orderinf> orderinfs= orderinfMapper.selectByExampleWithObject(example);
        return orderinfs;
    }

    @Override
    public List<Orderinf> SelectAll() {
        return null;
    }
}
